#qfdl baidu tudou
require 'qfdl.rb'
require 'baidu\baidusearch.rb'
require 'tudou\tudouget.rb'

comics = qfdl1
open('qfdl.txt','w').puts comics
posted = tudougets
open('tudouposted.txt','w').puts posted
wants=[]
comics.each{|comic| wants<<comic unless posted.include?(comic[1])}
open('q-t.txt','w').puts wants
wants.each{|comic| 
	print "\n",'time=',comic[0],' name=',comic[1]
	re = baidusearch comic[1]
	#content = comic[0]+re
	content = re
	if re=='sorry'
		print re
		next 
	end
	puts 'ok' if '1'== `perl tudou\\tudoupost.pl "#{comic[1]}" "#{content}"`
}